package com.wits.platform.entity;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Embeddable;

@Embeddable
public class MmrUserRolePK implements Serializable{
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 1295459207566208043L;

	public MmrUserRolePK(){
		
	}
	
	public MmrUserRolePK(String userId,String roleId){
		this.userId=userId;
		this.roleId=roleId;
	}
	
	private String userId;
	
	private String roleId;

	
	@Column(name="user_id",length=32)
	public String getUserId() {
		return userId;
	}

	public void setUserId(String userId) {
		this.userId = userId;
	}

	@Column(name="role_id",length=32)
	public String getRoleId() {
		return roleId;
	}

	public void setRoleId(String roleId) {
		this.roleId = roleId;
	}
	
    @Override 
    public int hashCode() { 
        final int prime = 31; 
        int result = 1; 
        result = prime * result + ((userId == null) ? 0 : userId.hashCode()); 
        result = prime * result    + ((roleId == null) ? 0 : roleId.hashCode()); 
        return result; 
    } 
 
    @Override 
    public boolean equals(Object obj) { 
        if (this == obj) 
            return true; 
        if (obj == null) 
            return false; 
        if (getClass() != obj.getClass()) 
            return false; 
        final MmrUserRolePK other = (MmrUserRolePK) obj; 
        if (userId == null) { 
            if (other.userId != null) 
                return false; 
        } else if (!userId.equals(other.userId)) 
            return false; 
            if (roleId == null) { 
                if (other.roleId != null) 
                    return false; 
            } else if (!roleId.equals(other.roleId)) 
                return false; 
        return true; 
    } 
}
